﻿using Learun.Util;
using SqlSugar;
using System;
using System.Collections.Generic;
namespace Learun.Application.TwoDevelopment.ZZDT_EC

{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-03-07 13:45
    /// 描 述：工程数据图元（就是CAD里的句柄）
    /// </summary>
    [SugarTable(TableName = "ec_enginedata_pixel")]
    public class ec_enginedata_pixelEntity
    {
        #region 实体成员
        /// <summary>
        /// 工程数据图元ID
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string EngineDataPixelID { get; set; }
        /// <summary>
        /// 工程数据ID。<see cref="ec_enginedataEntity.EngineDataID"/>
        /// </summary>
        /// <returns></returns>
        public string EngineDataID { get; set; } = "";
        /// <summary>
        /// 图纸文件ID。<see cref="ec_drawing_fileEntity.DrawingFileID"/>
        /// </summary>
        /// <returns></returns>
        public string DrawingFileID { get; set; } = "";
        /// <summary>
        /// 元件库文件ID。可能有，也可能没有（比如反向关联时）。<see cref="ec_library_fileEntity.LibraryFileID"/>
        /// </summary>
        /// <returns></returns>
        public string LibraryFileID { get; set; } = "";
        /// <summary>
        /// 图元编码。即dwg里的句柄。
        /// </summary>
        /// <returns></returns>
        public string PixelCode { get; set; } = "";
        /// <summary>
        /// MaxPointX
        /// </summary>
        /// <returns></returns>
        public string MaxPointX { get; set; } = "";
        /// <summary>
        /// MaxPointY
        /// </summary>
        /// <returns></returns>
        public string MaxPointY { get; set; } = "";
        /// <summary>
        /// MinPointX
        /// </summary>
        /// <returns></returns>
        public string MinPointX { get; set; } = "";
        /// <summary>
        /// MinPointY
        /// </summary>
        /// <returns></returns>
        public string MinPointY { get; set; } = "";
        /// <summary>
        /// 标记位，表示这个记录是否在上一次图纸检入过程中<see cref="ec_enginedata_pixelService.SaveMuliteEntity(List{ec_enginedata_pixelEntity}, string, string)"/>未找到。
        /// 相当于逻辑删除。
        /// </summary>
        /// <returns></returns>
        public int DeleteFlg { get; set; } = 0;

        /// <summary>
        /// 类型
        /// </summary>
        public string RepresentationType { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.EngineDataPixelID = Guid.NewGuid().ToString();
            this.CreateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.CreateUserID = userInfo.userId;
        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            this.EngineDataPixelID = keyValue;
            this.UpdateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
        }
        #endregion

        #region 扩展字段
        /// <summary>
        /// 图纸文件名称
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string DrawingFileName { get; set; }
        /// <summary>
        /// 位号
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string TagNumber { get; set; }
        /// <summary>
        /// 对象类型ID
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string ObjectTypeID { get; set; }
        /// <summary>
        /// 对象类型名称
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string ObjectTypeName { get; set; }


        /// <summary>
        /// 工程数据属性集合
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<ec_enginedata_propertyEntity> EngineDataProperty { get; set; }
        #endregion
    }
}

